package com.bird.设计模式.结构型.组合模式;

/**
 * @data 2022/3/15 17:22
 * @author: bird
 * @description: 目录组件 (抽象类)
 */
public abstract class CatalogComponent {



    // 不支持添加操作
    public void add(CatalogComponent catalogComponent) {
        throw new UnsupportedOperationException("不支持添加操作...");
    }

    public void remove(CatalogComponent catalogComponent) {
        throw new UnsupportedOperationException("不支持删除操作...");
    }

    public String getName(CatalogComponent catalogComponent) {
        throw new UnsupportedOperationException("不支持获取名称操作...");
    }

    public Double getPrice(CatalogComponent catalogComponent) {
        throw new UnsupportedOperationException("不支持获取价格操作...");
    }

    public void print( ) {
        throw new UnsupportedOperationException("不支持打印操作...");
    }
}
